import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../common/strings.dart';

Widget defaultDialog(
    {String title = Strings.tip,
    String content = Strings.tip,
    String sure = Strings.sure,
    String cancel = Strings.cancel,
    Function? sureFunction,
    Function? cancelFunction}) {
  return AlertDialog(
    title: Text(title),
    content: Text(content),
    actions: [
      TextButton(
        onPressed: () {
          cancelFunction?.call();
          Get.back();
        },
        child: Text(cancel),
      ),
      TextButton(
        onPressed: () {
          sureFunction?.call();
          Get.back();
        },
        child: Text(sure),
      ),
    ],
  );
}
